package statemachine;

/**
 * 已售光状态类
 * 
 * @author guweiqiang
 * 2018年7月4日
 */
public class SoldOutState implements State {

	private Machine machine;

	public SoldOutState(Machine machine) {
		this.machine = machine;
	}
	
	// 投币
	public void insertCoin() {
		System.out.println("糖果已售光，请不要投币！");
	}

	// 退回硬币
	public void ejectCoin() {
		System.out.println("没有可退回的硬币！");
	}

	// 转动摇柄
	public void turnCrank() {
		System.out.println("糖果已售光，请不要转动摇柄！");
		machine.setState(machine.getNonCoinState());
	}

	// 喷出糖果
	public void dispense() {
		System.out.println("糖果已售光！");
	}

}
